package com.atguigu.gmall.threadpool;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author 卡尼奶
 * @Date 2022/5/23 18:42
 * @Version 1.0
 */
@Data
@ConfigurationProperties(prefix = "app.threadpool")
public class AppThreadPoolProperties {
    private Integer corePoolSize;
    private Integer maximumPoolSize;
    private Integer keepAliveTime;
    private Integer queueSize;
    private TimeUnit unit = TimeUnit.MINUTES;
    private RejectedExecutionHandler handler = new ThreadPoolExecutor.CallerRunsPolicy();
}
